#pragma once

class TutorialFrame : public UIElement
{
	Texture* m_baseFrame;
	Texture* m_circleIcon;
	Texture* m_closeIcon, *m_closeIconDown;
	Vertex3FRHWT m_baseVertices[4];
	Vertex3FRHWT m_iconVertices[4];
	Vertex3FRHWT m_closeVertices[4];
	CFont m_title;
	bool m_closeHovered;
	bool m_moveAble;
	Vertex2F m_moveLast;
	std::vector<std::string> m_lines;

public:
	TutorialFrame(ui32 x, ui32 y, ui32 dx, ui32 dy);
	void Draw();
	void OnMouseClick() { }
	void OnMouseMove(ui32 x, ui32 y, bool lDown, bool rDown);
	void MouseActivity(bool left, Vertex2F pos, bool up);
	std::string szTitle;
	void SetText(std::string szText)
	{
		m_lines.clear();
		char* tmp = new char[szText.length() + 1];
		strcpy(tmp, szText.c_str());
		char* l = strtok(tmp, "\n");
		if(l)
			m_lines.push_back(l);
		else
			return;
		while((l = strtok(0, "\n")))
			m_lines.push_back(l);
	}
};